/**
 * \file WindowApp_Win32.h
 * \brief Window application declaration class for Windows platforms
 * \author Edouard ROGE
 * \date 21 March 2013
 */
#ifndef _WINDOWAPP_WIN32_
#define _WINDOWAPP_WIN32_

#include <Windows.h>
#include "Core/Define/Define.h"
#include "Core/Error/Error.h"
#include "Core/String/String.h"
#include "Core/Memory/HeapObject.h"

/**
 * \class PluginInterface
 * \brief Base class for every plug-in interface
 */
class WindowApp : public HeapObject
{
public:

	/**
	 * \fn WindowApp();
	 * \brief Constructor
	 */
	WindowApp();
	
	/**
	 * \fn virtual ~WindowApp();
	 * \brief Destructor
	 */
	virtual ~WindowApp();
	
	/**
	 * \fn error Create(HINSTANCE _hInstance, int _nCmdShow, const String & _strTitle);
	 * \param _hInstance handle to the application instance
	 * \param _nCmdShow window flags
	 * \param _strTitle window title
	 * \return Error if occurs
	 * \brief 
	 */
	error Create(HINSTANCE _hInstance, int _nCmdShow, const String & _strTitle);

	/**
	 * \fn error Destroy();
	 * \return Error if occurs
	 * \brief Destroy function
	 */
	error Destroy();

	/**
	 * \fn void Loop();
	 * \brief Loop and perform windows message
	 */
	void Loop();

private:

	/** Configuration file */
	// const char * CONFIGFILE = "../Data/Config/win32.cfg";

	/** Instance unique */
	static WindowApp		* ms_pInstance;

	/** Window width */
	uint32 m_uWidth;

	/** Window height */
	uint32 m_uHeight;

	/** True if window is in full screen mode */
	bool m_bFullscreen;

	/** Handle to the window */
	HWND m_hWnd;

	/** Callback function to perform windows message */
	static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

};

#endif // _PLUGININTERFACE_WIN32_
